package com.uwlaser.domain;

import com.uwlaser.base.CommonModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.IdType;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.util.Date;
import java.sql.Timestamp;

/**
* @author zk-Qin
* @date 2022-05-11
*/
@Data
@Builder
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
@TableName("data_product_path")
public class DataProductPath extends CommonModel<DataProductPath> implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "ID")
    @TableId(type= IdType.AUTO)
    private String id;

    @ApiModelProperty(value = "产品SN")
    @NotBlank
    private String productSn;

    @ApiModelProperty(value = "产品型号")
    @NotBlank
    private String productCode;

    @ApiModelProperty(value = "产品类型")
    @NotBlank
    private String productType;

    @ApiModelProperty(value = "工序编码")
    @NotBlank
    private String operationCode;

    @ApiModelProperty(value = "工序名称")
    @NotBlank
    private String operationName;

    @ApiModelProperty(value = "执行顺序")
    @NotBlank
    private Integer executionOrder;

    @ApiModelProperty(value = "上工序编号")
    @NotBlank
    private String upStationCode;

    @ApiModelProperty(value = "下工序编号")
    @NotBlank
    private String nextStationCode;

    @ApiModelProperty(value = "是否校验")
    @NotBlank
    private String isCheck;

    @ApiModelProperty(value = "是否屏蔽")
    @NotBlank
    private String isShield;

    @ApiModelProperty(value = "当前工序结果")
    @NotBlank
    private String result;

    @ApiModelProperty(value = "返修标识")
    @NotBlank
    private String repairSign;

    @ApiModelProperty(value = "产线编号")
    private String lienCode;

    @ApiModelProperty(value = "工段编号")
    private String sectionCode;

    @ApiModelProperty(value = "工位编号")
    private String stationCode;

    @ApiModelProperty(value = "创建人")
    @TableField(fill= FieldFill.INSERT)
    private String createBy;

    @ApiModelProperty(value = "创建时间")
    @TableField(fill= FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty(value = "更新人")
    @TableField(fill= FieldFill.INSERT_UPDATE)
    private String updateBy;

    @ApiModelProperty(value = "更新时间")
    @TableField(fill= FieldFill.INSERT_UPDATE)
    private Date updateTime;

    public void copyFrom(DataProductPath source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
